#ifndef LOGONWIDGET_H
#define LOGONWIDGET_H

#include <QWidget>
#include <qtcpsocket.h>
#include <QHostAddress>
#include <QMessageBox>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QJsonObject>
#include <QJsonDocument>
#include <QJsonParseError>
#include <QDebug>
#include "friendlist.h"
#include <QtWebSockets/QtWebSockets>
#include "registerwidget.h"
#include "user.h"
#include "maininterfacewidget.h"
#include "Global.h"


QT_BEGIN_NAMESPACE
namespace Ui { class LogOnWidget; }
QT_END_NAMESPACE

class LogOnWidget : public QWidget
{
    Q_OBJECT

public:
    LogOnWidget(QWidget *parent = nullptr);
    ~LogOnWidget();
    friend class MainInterfaceWidget;

private slots:
    void on_btn_login_clicked();


    void on_btn_signup_clicked();

private:
    Ui::LogOnWidget *ui;
    QTcpSocket *socket;
    QString ip;
    QString port;
    QNetworkAccessManager manager;
    MainInterfaceWidget* mainWindow;
    user userSelf;
};
#endif // LOGONWIDGET_H

